function checkbox_multi_plot(data_draw_list, num_motors, fig_name)
    % 确保数据非空且为 cell 数组
    if isempty(data_draw_list) || ~iscell(data_draw_list)
        error('输入数据必须是非空 cell 数组！');
    end
    
    num_datasets = length(data_draw_list); % 计算数据集数量
    
    % 提取时间数据（假设所有数据集的时间列相同）
    time_origin = data_draw_list{1}(end, :);
    time_origin(end+1) = time_origin(end) - time_origin(end-1) + time_origin(end);
    min_time = min(time_origin);
    time_norm = time_origin - min_time;
    
    % 计算每组的步长
    s = size(data_draw_list{1});
    step = (s(1) - 1) / num_motors;
    
    % 预分配时间插值数组
    time = zeros(1, step * (length(time_norm) - 1));
    
    % 使用 linspace 进行插值
    index = 1;
    for i = 1:length(time_norm)-1
        temp = linspace(time_norm(i), time_norm(i+1), step);
        time(index:index+step-1) = temp;
        index = index + step;
    end
    
    % 重新整理数据，将每个 data_draw 处理成 num_motors 组
    data_list = cell(num_datasets, 1);
    for d = 1:num_datasets
        data_reshape = reshape(data_draw_list{d}(1:end-1, :), num_motors, step, []);
        data_list{d} = reshape(data_reshape, num_motors, []);
    end
    
    % 设置颜色和标记
    colors = lines(num_motors);
    markers = {'o', 's', 'd', '^', 'v', 'p', 'h', '>', '<', 'o', 's', 'd', '^', 'v'};
    
    % 创建图像并设置名称
    figure('Name', fig_name, 'NumberTitle', 'off');
    hold on;

    % 创建复选框 UI
    checkboxes = gobjects(num_motors, 1);
    for i = 1:num_motors
        checkboxes(i) = uicontrol('Style', 'checkbox', 'String', sprintf('Motor %d', i), ...
                                  'Value', 1, ...
                                  'FontSize', 15, ...
                                  'Units', 'normalized', ...
                                  'Position', [0.03, 0.9 - 0.05 * (i - 1), 0.07, 0.05], ...
                                  'Callback', @(src, event) updatePlot());
    end

    % 初始绘制
    scatterHandles = gobjects(num_motors, num_datasets);
    updatePlot();
    
    function updatePlot()
        hold on;
        
        for i = 1:num_motors
            if checkboxes(i).Value == 1
                for d = 1:num_datasets
                    if isvalid(scatterHandles(i, d)) && ishandle(scatterHandles(i, d))
                        set(scatterHandles(i, d), 'XData', time, 'YData', data_list{d}(i, :));
                    else
                        scatterHandles(i, d) = scatter(time, data_list{d}(i, :), 10, colors(i, :), ...
                            markers{mod(i-1, length(markers)) + 1}, 'filled');
                    end
                end
            else
                for d = 1:num_datasets
                    if isvalid(scatterHandles(i, d)) && ishandle(scatterHandles(i, d))
                        set(scatterHandles(i, d), 'XData', [], 'YData', []);
                    end
                end
            end
        end
        
        hold off;
    end
    
    xlabel('Time');
    ylabel('Value');
    title(fig_name); % 设置图像标题
    legend(arrayfun(@(i) sprintf('Motor %d', i), 1:num_motors, 'UniformOutput', false), 'Location', 'bestoutside');
    
    grid on;
    hold off;
end
